package com.dragon.modules.yuegou.query.merchant;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.dragon.modules.yuegou.entity.merchant.MerchantDeliveryEntity;
import com.dragon.modules.yuegou.enums.merchant.MerchantDeliveryType;
import com.dragon.modules.yuegou.mybatis.Condition;
import com.dragon.modules.yuegou.mybatis.Query;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonInclude.Include;
import com.fasterxml.jackson.annotation.JsonUnwrapped;

import java.math.BigDecimal;
import java.time.LocalDateTime;

/**
 * 商户配送信息 动态查询条件
 * 
 * @author pbuilder generated
 * @date 2023-08-07 11:13:58
 * @version 2.0
 */
@JsonInclude(Include.NON_NULL)
public class MerchantDeliveryQuery extends MerchantDeliveryEntity implements Query<MerchantDeliveryEntity>{

    /** 商户ID查询条件 */
	@JsonUnwrapped(prefix = "merchantId")
	private Condition<String> merchantIdCondition;

    /** 配送商户ID查询条件 */
	@JsonUnwrapped(prefix = "daMerchantId")
	private Condition<String> daMerchantIdCondition;

    /** 配送门店ID查询条件 */
	@JsonUnwrapped(prefix = "daShopId")
	private Condition<String> daShopIdCondition;

    /** [枚举]配送类型：0-自主配送-AUTONOMY、1-达达配送-DADA查询条件 */
	@JsonUnwrapped(prefix = "type")
	private Condition<MerchantDeliveryType> typeCondition;

    /** 创建时间查询条件 */
	@JsonUnwrapped(prefix = "createdTime")
	private Condition<LocalDateTime> createdTimeCondition;

    /** 运费查询条件 */
	@JsonUnwrapped(prefix = "freight")
	private Condition<BigDecimal> freightCondition;

	/**
	 * 构造一个查询条件对象
	 */
	public MerchantDeliveryQuery() {
		super();
	}

	/**
	 * 依据实体对象构造一个查询条件对象
	 * 
	 * @param entity 实体对象
	 */
	public MerchantDeliveryQuery(MerchantDeliveryEntity entity) {
		super(entity);
	}

	/**
	 * 依据其它查询条件对象的信息构造一个查询条件对象
	 * 
	 * @param other 查询条件对象
	 */
	public MerchantDeliveryQuery(MerchantDeliveryQuery other) {
		super(other);
		if(other.merchantIdCondition != null) {
			this.merchantIdCondition = other.merchantIdCondition.copy();
		}
		if(other.daMerchantIdCondition != null) {
			this.daMerchantIdCondition = other.daMerchantIdCondition.copy();
		}
		if(other.daShopIdCondition != null) {
			this.daShopIdCondition = other.daShopIdCondition.copy();
		}
		if(other.typeCondition != null) {
			this.typeCondition = other.typeCondition.copy();
		}
		if(other.createdTimeCondition != null) {
			this.createdTimeCondition = other.createdTimeCondition.copy();
		}
		if(other.freightCondition != null) {
			this.freightCondition = other.freightCondition.copy();
		}
	}

	@Override
	public QueryWrapper<MerchantDeliveryEntity> toQueryWrapper() {
		QueryWrapper<MerchantDeliveryEntity> wrapper = new QueryWrapper<>(this);
		if (merchantIdCondition != null) {
			merchantIdCondition.toWrapper(wrapper, COL_MERCHANT_ID);
		}
		if (daMerchantIdCondition != null) {
			daMerchantIdCondition.toWrapper(wrapper, COL_DA_MERCHANT_ID);
		}
		if (daShopIdCondition != null) {
			daShopIdCondition.toWrapper(wrapper, COL_DA_SHOP_ID);
		}
		if (typeCondition != null) {
			typeCondition.toWrapper(wrapper, COL_TYPE);
		}
		if (createdTimeCondition != null) {
			createdTimeCondition.toWrapper(wrapper, COL_CREATED_TIME);
		}
		if (freightCondition != null) {
			freightCondition.toWrapper(wrapper, COL_FREIGHT);
		}
		return wrapper;
	}

	/**
	 * 构造并返回商户ID查询条件
	 * 
	 * @return merchantIdCondition 商户ID查询条件
	 */
	public Condition<String> merchantId() {
		this.merchantIdCondition = new Condition<>();
		return this.merchantIdCondition;
	}
	
	/**
	 * 获取商户ID查询条件
	 * 
	 * @return merchantIdCondition 商户ID查询条件
	 */
	public Condition<String> getMerchantIdCondition() {
		return merchantIdCondition;
	}

	/**
	 * 设置商户ID查询条件
	 * 
	 * @param merchantIdCondition 商户ID查询条件
	 */
	public void setMerchantIdCondition(Condition<String> merchantIdCondition) {
		this.merchantIdCondition = merchantIdCondition;
	}

	/**
	 * 构造并返回配送商户ID查询条件
	 * 
	 * @return daMerchantIdCondition 配送商户ID查询条件
	 */
	public Condition<String> daMerchantId() {
		this.daMerchantIdCondition = new Condition<>();
		return this.daMerchantIdCondition;
	}
	
	/**
	 * 获取配送商户ID查询条件
	 * 
	 * @return daMerchantIdCondition 配送商户ID查询条件
	 */
	public Condition<String> getDaMerchantIdCondition() {
		return daMerchantIdCondition;
	}

	/**
	 * 设置配送商户ID查询条件
	 * 
	 * @param daMerchantIdCondition 配送商户ID查询条件
	 */
	public void setDaMerchantIdCondition(Condition<String> daMerchantIdCondition) {
		this.daMerchantIdCondition = daMerchantIdCondition;
	}

	/**
	 * 构造并返回配送门店ID查询条件
	 * 
	 * @return daShopIdCondition 配送门店ID查询条件
	 */
	public Condition<String> daShopId() {
		this.daShopIdCondition = new Condition<>();
		return this.daShopIdCondition;
	}
	
	/**
	 * 获取配送门店ID查询条件
	 * 
	 * @return daShopIdCondition 配送门店ID查询条件
	 */
	public Condition<String> getDaShopIdCondition() {
		return daShopIdCondition;
	}

	/**
	 * 设置配送门店ID查询条件
	 * 
	 * @param daShopIdCondition 配送门店ID查询条件
	 */
	public void setDaShopIdCondition(Condition<String> daShopIdCondition) {
		this.daShopIdCondition = daShopIdCondition;
	}

	/**
	 * 构造并返回[枚举]配送类型：0-自主配送-AUTONOMY、1-达达配送-DADA查询条件
	 * 
	 * @return typeCondition [枚举]配送类型：0-自主配送-AUTONOMY、1-达达配送-DADA查询条件
	 */
	public Condition<MerchantDeliveryType> type() {
		this.typeCondition = new Condition<>();
		return this.typeCondition;
	}
	
	/**
	 * 获取[枚举]配送类型：0-自主配送-AUTONOMY、1-达达配送-DADA查询条件
	 * 
	 * @return typeCondition [枚举]配送类型：0-自主配送-AUTONOMY、1-达达配送-DADA查询条件
	 */
	public Condition<MerchantDeliveryType> getTypeCondition() {
		return typeCondition;
	}

	/**
	 * 设置[枚举]配送类型：0-自主配送-AUTONOMY、1-达达配送-DADA查询条件
	 * 
	 * @param typeCondition [枚举]配送类型：0-自主配送-AUTONOMY、1-达达配送-DADA查询条件
	 */
	public void setTypeCondition(Condition<MerchantDeliveryType> typeCondition) {
		this.typeCondition = typeCondition;
	}

	/**
	 * 构造并返回创建时间查询条件
	 * 
	 * @return createdTimeCondition 创建时间查询条件
	 */
	public Condition<LocalDateTime> createdTime() {
		this.createdTimeCondition = new Condition<>();
		return this.createdTimeCondition;
	}
	
	/**
	 * 获取创建时间查询条件
	 * 
	 * @return createdTimeCondition 创建时间查询条件
	 */
	public Condition<LocalDateTime> getCreatedTimeCondition() {
		return createdTimeCondition;
	}

	/**
	 * 设置创建时间查询条件
	 * 
	 * @param createdTimeCondition 创建时间查询条件
	 */
	public void setCreatedTimeCondition(Condition<LocalDateTime> createdTimeCondition) {
		this.createdTimeCondition = createdTimeCondition;
	}

	/**
	 * 构造并返回运费查询条件
	 * 
	 * @return freightCondition 运费查询条件
	 */
	public Condition<BigDecimal> freight() {
		this.freightCondition = new Condition<>();
		return this.freightCondition;
	}
	
	/**
	 * 获取运费查询条件
	 * 
	 * @return freightCondition 运费查询条件
	 */
	public Condition<BigDecimal> getFreightCondition() {
		return freightCondition;
	}

	/**
	 * 设置运费查询条件
	 * 
	 * @param freightCondition 运费查询条件
	 */
	public void setFreightCondition(Condition<BigDecimal> freightCondition) {
		this.freightCondition = freightCondition;
	}

}
